# vs2cmake test justfile
# Run with: just test-vs2cmake
set shell := ["powershell.exe", "-c"]

# Variables
test_project_name := "QtWidgetsForTest"
vs_project_path := "test_projects/vs_qt_project/" + test_project_name
cmake_output_path := "test_projects/cmake_output"
qt_dir := "C:/Qt/Qt5.12.5/5.12.5/msvc2017_64"
clangd_template := "./config/clangd_template.yaml"
# Default recipe to run when just is called without arguments
default:
    @just --list

# Run tests for vs2cmake
test-vs2cmake:
    cargo run --release -- --input "{{vs_project_path}}" --output "{{cmake_output_path}}" --qt-dir "{{qt_dir}}" -c -p -d --clangd-template "{{clangd_template}}"

# Clean test output directory
clean-test-output:
    if (Test-Path "{{cmake_output_path}}") { Remove-Item -Recurse -Force "{{cmake_output_path}}" }

# Build CMake project and generate compile_commands.json
build-cmake build_type="Release":
    python build_cmake.py "{{cmake_output_path}}/{{test_project_name}}" --build-type "{{build_type}}"

# Run full conversion and build pipeline
convert-and-build build_type="Release": test-vs2cmake
    just build-cmake "{{build_type}}"


# Show help
help:
    @just --list

# List all available commands
list:
    @just --list 

# 打包项目
package:
    python package_win.py 